<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>认购确认书发放</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select.css">
	<style>
		.text-name {
		    display: inline-block;
		    padding: 5px 0px;
		    color: #666;
		    width: auto;
		    font-size: 14px;
		    text-align: right;
		}
		.content-table-three{
			width: 1080px;
		}
		.content-table-three tbody tr td {
		    max-width: 250px;
		    min-width: 30px;
		}
		.content-table-three tbody tr td p {
		    text-align: right;
		    padding-left: 12px;
		}
		.content-table-three tbody tr td span{
			padding-right: 12px;
		}
		.content-table-three tbody tr td:nth-child(1){
			width: 40px;
			text-align: center;
		}
		.content-table-three tbody tr td:nth-child(2){
			width: 150px;
		}
		.content-table-three tbody tr td:nth-child(3){
			width: 200px;
		}
		.content-table-three tbody tr td:nth-child(4){
			width: 140px;
		}
		.content-table-three tbody tr td:nth-child(5){
			width: 180px;
		}
		.content-table-three tbody tr td:nth-child(6){
			width: 160px !important;
		}
		.content-table-three tbody tr td:nth-child(2) span{
			width: 55px;
		}
		.content-table-three tbody tr td:nth-child(3) span{
			width: 150px;
		}
		.content-table-three tbody tr td:nth-child(4) span{
			width: 80px;
		}
		.content-table-three tbody tr td:nth-child(5) span{
			width: 125px;
		}
		.content-table-three tbody tr td:nth-child(6) span{
			width: 105px;
		}
		.content-table-three tbody tr:nth-child(2) td p {
		    text-align: left;
		}
		.content-table-three tbody tr:nth-child(2) td p>span {
		    width: auto;
		}
		.content-btn {
		    padding-bottom: 5px;
		}
		.export-btn {
		    float: left;
		    margin-top: 0px;
		    margin-right: 12px;
		}
		.content-btn> .btn-style-two {
		    float: right;
		    margin-left: 8px;
		}
		.rowspanbg{
			background: #F9FBFF;
		}
		.color-operation:hover {
		    text-decoration: underline;
		    cursor: pointer;
		}
	</style>
</head>
<body>
	<div class="main-content">
		<div class="main-bg">
			<p class="content-title">认购确认书发放</p>
			<form id="seachContractInboundForm">  
			   <input name="confirtrackstatusList[0]" value="3"  type="hidden">
			   <input name="confirtrackstatusList[1]" value="5"  type="hidden">
			   <input name="confirtrackstatusList[2]" value="6"  type="hidden">
			<div class="content-form">
				<ul>
					<li><span class="text-name">项目名称：</span><input  name="projectname" type="text"></li>
					<li><span class="text-name">部门名称：</span><input  name="appoint.departmentname"  type="text"></li>
					<li><span class="text-name">客户名称：</span><input  name="appoint.custname"  type="text"></li>
					<li><span class="text-name">快递单号：</span><input  name="confirtracknumber"  type="text"></li>
					<li><span class="text-name">确认书发放状态：</span>
					<select class="multiselect" name="confirtrackstatus"   id="single">
						<option value="3">待发放</option>
						<option value="5">已发放</option>
						<option value="">待签收</option>
						<option value="">已撤回</option>
					</select></li>
					<li><button class="btn-style-two" type="button" id="seachContractInbound">搜索</button></li>
				</ul>
			</div>
			</form>
			<div class="content-btn">
				        <button class="export-btn clearfix" id="confirmingOrder" >认购确认书发放</button>
						<!-- <a href="confirmingOrder.html" class="export-btn clearfix">认购确认书发放</a> -->
						<button class="export-btn clearfix" id="withdraw" >撤销发放</button>
						<button class="btn-style-two clearfix">导出</button>
						<button class="btn-style-two clearfix">导入</button>
						<button class="btn-style-two clearfix">全选</button>
					</div>
			<div class="content-list"> 
				<div class="info-list" dataTableTable = "true" bindClick = "seachContractInbound" bindForm = "seachContractInboundForm" dataAction = "/contractDetail/findList">
					
					<table class="content-table-three" cellspacing="0" cellpadding="0">
						<tbody>
							<tr>
								<td rowspan="2" class="rowspanbg"><input type="checkbox"></td>
								<td>
									<p>确认书发放状态：<span name  = "confirtrackstatus" type = "table" dataType="dict" dictType="confirtrackstatus"></span></p>
								</td>
								<td>
									<p>项目编号：<span name  = "projectcode" type = "table"></p>
									<p>项目名称：<span name  = "projectname" type = "table"></p>
									<p>部门名称：<span name  = "appoint.departmentname" type = "table"></p>
								</td>
								<td>
									<p>客户名称：<span name  = "appoint.custname" type = "table"></p>
									<p>发放人：<span name  = "confiruser" type = "table"></p>
									<p>签收人：<span name  = "signBy" type = "table"></p>
								</td>
								<td>
									<p>客户编号：<span name  = "appoint.custcode" type = "table"></p>
									<p>发放时间：<span name  = "issuedate" type = "table"></p>
									<p>签收时间：<span name  = "signDate" type = "table"></p>
								</td>
								<td>
									<p>到账金额：<span name  = "transfercash" type = "table"></p>
									<p>快递单号：<span name  = "confirtracknumber" type = "table" class="color-operation" onclick="seeLogistics()"></span></p>
								</td>
							</tr>
							<tr>
								<td colspan="5"><p>备注：<span name  = "remark" type = "table"></p></td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/tableTable.js"></script>
    <script type="text/javascript">
    	var number =0;
        $(document).ready(function (){//新增
			$('#confirmingOrder').click(function(){
				var datas =[];
				$('.info-list').find('table').each(function(){
					var $this = $(this);
					var $input = $this.children('tbody').children('tr').eq(0).children('td').eq(0).find('input');
					 if ($input.is(':checked')) {
						 var index =$input.parent().parent().parent().find("input[name='index']").val();
						 var data = $("div[dataTableTable = 'true']").getAllTableData()[index];
						 datas.push(data);
					 }					
				})
				if(datas.length == 0 ){
					layer.msg("请至少选择一条需要发放的认购确认书！",{
    				    offset:'20%'
    				});	
					return  false;
				}
				for (var i = 0; i < datas.length; i++) {
					console.log(datas[i].confirtrackstatus);
					if(datas[i].confirtrackstatus !=4){
						layer.msg("请选择都为带发放的认购确认书",{
	    				    offset:'20%'
	    				});			
						return  false;
					}
				}	
				parent.setData(datas);
	    		window.location.href="confirmingOrder.html";
			})
			$('#withdraw').click(function(){
				var datas =[];
				$('.info-list').find('table').each(function(){
					var $this = $(this);
					var $input = $this.children('tbody').children('tr').eq(0).children('td').eq(0).find('input');
					 if ($input.is(':checked')) {
						 var index =$input.parent().parent().parent().find("input[name='index']").val();
						 var data = $("div[dataTableTable = 'true']").getAllTableData()[index];						
						 datas.push(data);
					 }					
				})
				if(datas.length == 0 ){
					layer.msg("请至少选择一条发放中的认购确认书！",{
    				    offset:'20%'
    				});	
					
					return  false;
				}
				for (var i = 0; i < datas.length; i++) {
					if(datas[i].confirtrackstatus !=5){
						layer.msg("请选择都为发放中的认购确认书",{
	    				    offset:'20%'
	    				});			
						return  false;
					}
				}			
		         	parent.setData(datas);
		     		parent.layer.open({
					      type: 2,
					      title: '确认撤销',
					      shadeClose: true,
					      shade: 0.2,
					      maxmin: true, //开启最大化最小化按钮
					      area: ['500px', '300px'],
					      content: 'withdraw.html',
					       end:function(){
						 	 $('div[dataTableTable="true"]').ECDATableTable();
						  }
					    });
			})
		 });
        function seeLogistics(){
        	parent.layer.open({
			      type: 2,
			      title: '查看物流',
			      shadeClose: true,
			      shade: 0.2,
			      maxmin: true, //开启最大化最小化按钮
			      area: ['870px', '450px'],
			      content: 'seeLogistics.html'
			    });
        }
		function  del(){
				  parent.layer.open({
			      type: 2,
			      title: '撤销发放',
			      shadeClose: true,
			      shade: 0.2,
			      maxmin: true, //开启最大化最小化按钮
			      area: ['400px', '250px'],
			      content: 'confirmingReturn.html'
			});
		}
        function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };
        $('.main-content').resize(function(){
            getHeight();
        });
        function tableCallBack($this){
        	
        }
	</script>

</body>
</html>